﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Wpf3D.ViewModels;
using Wpf3D.WcfServiceLibrary1;

namespace Wpf3D
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        Service1Client sc = new Service1Client();
        public MainWindow()
        {
            InitializeComponent();
            for (int i = 0; i < 100; i++)
            {
                TextBox tbx = new TextBox();

                tbx.Text = i.ToString();

                Test.Children.Add(tbx);
            }
        }

        private void btn1_Click(object sender, RoutedEventArgs e)
        {
            MessageBox.Show("dddd");
        }

        private void repeatbtn_Click(object sender, RoutedEventArgs e)
        {
            var num = Convert.ToDouble(this.textbox3.Text);
            this.textbox3.Text = (++num).ToString();

        }

        private void chk1_Indeterminate(object sender, RoutedEventArgs e)
        {
            MessageBox.Show("good");

        }

        private void btnWCF_Click(object sender, RoutedEventArgs e)
        {
           
            CompositeType myType = new CompositeType();
            myType.BoolValue = true;
            myType.StringValue = "hello";

            CompositeType returnType = new CompositeType();

            returnType = sc.GetDataUsingDataContract(myType);
            string refs="abc";
            string outs = "out";


            MessageBox.Show(sc.GetData(Convert.ToInt32(this.textbox1.Text),ref refs, out outs));
            MessageBox.Show(refs+outs);
            MessageBox.Show(returnType.StringValue);

        }

        private void btn2_Click(object sender, RoutedEventArgs e)
        {
            sc.TestSingleMsgModel("Hello, WCF!");
            MessageBox.Show("Invoke successfully!");

        }


    }
}
